|
|
|
BlueCielo Meridian Enterprise 2012 Developer's Guide | BlueCielo ECM Solutions |
This interface supported by the AMEDMUI::AMDocumentUI object implements functionality required to modify content of a document stored in the vault.
Name | Description |
---|---|
Opens document file with default application |
|
Replaces document content from external file |
|
Replaces document content with newly scanned image |
Run
Internally invokes the standard shell API ShellExecuteEx against the IAMEdmUICache::Location property.
ImportFile
Replaces document content with content of an external file. It can provide a user interface to select the file to import. It also causes the ReplaceContent-related events to occur. And it modifies the AMDocument::FileType and AMDocument::ImportedFrom properties.
Related information
IAMEdmUIPersist interface
The example code below demonstrates how to execute the default document-related application from code. This will work for both AMFS and Local Workspace. It replaces document content from a file or displays a dialog to select the file.
Public Sub LaunchDocApp(doc As AMDocument, Wnd as Long)
If Not doc Is Nothing Then
'Create AMDocumentUI and take IAMEdmUIEdit interface
Dim DocEdit As IAMEdmUIEdit
Set DocEdit = New AMDocumentUI
'Take IAMEdmUIPersist interface from AMDocumentUI object
Dim DocPersist As IAMEdmUIPersist
Set DocPersist = DocLocation
'Initialize AMDocumentUI object with AMDocument
DocPersist.Init doc
'Execute document application
DocEdit.Run Wnd 'Wnd is optional – can be 0
Set DocEdit = Nothing
Set DocCache = Nothing
Set DocPersist = Nothing
End If
End Sub Public Sub ImportFromFile(doc As AMDocument, Wnd as Long, Services as Object File as String)
If Not doc Is Nothing Then
'Create AMDocumentUI and take IAMEdmUIEdit interface
Dim DocEdit As IAMEdmUIEdit
Set DocEdit = New AMDocumentUI
'Take IAMEdmUIPersist interface from AMDocumentUI object
Dim DocPersist As IAMEdmUIPersist
Set DocPersist = DocLocation
'Initialize AMDocumentUI object with AMDocument and Services
'Services are required to fire Replace Content related events
'In context of UI Extension Services are available as Designer.GetHostService(SERVICE_PROVIDER)
DocPersist.Init doc, Services
If File.Len() > 0 Then
' No UI required
DocEdit.ImportFile 0, false, File, “”
Else
'Show dialog ti select file
DocEdit.ImportFile Wnd, true, “”, “Import Dialog Caption”
End If
Set DocEdit = Nothing
Set DocPersist = Nothing
End If
End Sub
Copyright © 2000-2012 BlueCielo ECM Solutions |